<%- include('../public/page_header.html')%>

    <div class="panel panel-default">
        <!--列表展示-->
        <div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr class="th">
                        <th class="text-center">导航名称</th>
                        <th class="text-center">跳转地址</th>
                        <th class="text-center">导航位置</th>
                        <th class="text-center">新窗口打开</th>
                        <th class="text-center">排序</th>
                        <th class="text-center">状态</th>
                        <th class="text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <% for(let i=0; i<list.length; i++){%>
                        <tr>
                            <td class="text-center">
                              <span class="chSpanNum" data-id="<%=list[i]._id%>" data-model="Nav" data-field="title">
                                <%=list[i].title%>
                              </span>
                            </td>
                            <td class="text-center">
                              <span class="chSpanNum" data-id="<%=list[i]._id%>" data-model="Nav" data-field="link">
                                <%=list[i].link%>
                              </span>
                            </td>
                            <td class="text-center">
                              <% if(list[i].position == 1){%>
                                顶部
                              <%}else if(list[i].position == 2){%>
                                中间
                              <%}else if(list[i].position == 3){%>
                                底部
                              <%}else{%>
                                
                              <%}%>
                            </td>
                            <td class="text-center">
                              <% if(list[i].is_opennew == 1){%>
                                本窗口
                              <%}else if(list[i].is_opennew == 2){%>
                                新窗口
                              <%}else{%>
                                
                              <%}%> 
                            </td>
                            <td class="text-center">
                              <span class="chSpanNum" data-id="<%=list[i]._id%>" data-model="Nav" data-field="sort">
                                <%=list[i].sort%>
                              </span>
                            </td>
                            <td class="text-center">
                              <% if(list[i].status == 1){%>
                                <img src="/admin/images/yes.png" class="chStatus" data-id="<%=list[i]._id%>" 
                                     data-model="Nav" data-field="status">
                              <%}else{%>
                                <img src="/admin/images/no.png"  class="chStatus" data-id="<%=list[i]._id%>"
                                     data-model="Nav" data-field="status">
                              <%}%>
                            </td>
                            <td class="text-center">
                                <a href="/<%=adminPath%>/nav/edit?id=<%=list[i]._id%>">修改</a>
                                <a class="delete" href="/<%=adminPath%>/nav/delete?id=<%=list[i]._id%>">删除</a>
                            </td>
                        </tr>
                    <%}%>
                </tbody>
            </table>
        </div>
    </div>
    </body>
</html>